enable_testing()

add_executable(test_timer test_timer.cpp)
if(WIN32)
  target_link_libraries(test_timer ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(test_timer pthread brynet)
endif()
add_test(TestTimer test_timer)

add_executable(test_wait_group test_wait_group.cpp)
if(WIN32)
  target_link_libraries(test_wait_group ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(test_wait_group pthread brynet)
endif()
add_test(TestWaitGroup test_wait_group)

add_executable(test_sync_connect test_sync_connect.cpp)
if(WIN32)
  target_link_libraries(test_sync_connect ws2_32 brynet)
elseif(UNIX)
  find_package(Threads REQUIRED)
  target_link_libraries(test_sync_connect pthread brynet)
endif()
add_test(TestSyncConnect test_sync_connect)